import random

def gen(nn, start, ending):
	print(nn)
	for i in range(nn):
		for j in range(nn):
			print(random.randint(start, ending), end = ' ')
		print()

def main():
	print(2)

	gen(51, 1, 500)	
	gen(500, 999999999, 1000000000)
	
if __name__ == "__main__":
	main()
